﻿#region
/*******************************************************************************
** File Name:		    NewsCatalogRepository.cs
** Creator:		        chao.jiang 
** EMail:               chao.jiang 
** Create date:	        
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using Phoenix.Entity;
using Phoenix.Respository;
using IBatisNet.DataMapper;
using Phoenix.Data.IBatis;

namespace Phoenix.IBatisRepository
{
    public class NewsCatalogRepository : BaseIBatisDao,INewsCatalog
    {
    
		#region  Auto Generation

        public NewsCatalogRepository()
            : base("/Config/IBatis/86TCMap.Config")
        {

        }
        		
        public System.Int32 AddNewsCatalog(ENewsCatalog entity)
        {
			string stmtId = "NewsCatalogMap.InsertNewsCatalog";
			 Object obj = base.SqlMapper.Insert(stmtId, entity);
			 return (System.Int32)obj;
        }
        
		public  ENewsCatalog GetByCatalogID (System.Int32 catalogID)
        {
			string stmtId = "NewsCatalogMap.SelectByCatalogID";
			return base.SqlMapper.QueryForObject<ENewsCatalog>(stmtId, catalogID);
        }
        
        public  void DeleteByCatalogID (System.Int32 catalogID)
        {
			string stmtId = "NewsCatalogMap.DeleteByCatalogID";
			base.SqlMapper.Update(stmtId, catalogID);
        }
        
        public  void UpdateByCatalogID (ENewsCatalog entity)
        {
			string stmtId = "NewsCatalogMap.UpdateByCatalogID";
			base.SqlMapper.Update(stmtId, entity);
        }


		#endregion

        public  IList<ENewsCatalog> GetByParentID(System.Int32 parentId)
        {
            string stmtId = "NewsCatalogMap.SelectByParentID";
            return base.SqlMapper.QueryForList<ENewsCatalog>(stmtId, parentId);

        }
    }
}

